﻿/*
 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2023-2023. All rights reserved.
 */

#ifndef TYPES_H            // Guard against multiple inclusion
#define TYPES_H

/*********************************************************************
*
*       Defines, basic types
*
**********************************************************************
*/

typedef unsigned char U8;
typedef unsigned short U16;
#if (defined (__SES_ARM) || defined (__ICCARM__))
    typedef unsigned long U32;
#else
typedef unsigned int U32;
#endif
typedef signed char I8;
typedef signed short I16;
#if (defined (__SES_ARM) || defined (__ICCARM__))
    typedef signed long U32;
#else
typedef signed int I32;
#endif

#ifdef _MSC_VER
    #define U64   unsigned __int64
    #define I64   signed __int64
    #if _MSC_VER <= 1200
        #define U64_C(x) x##UI64
        #define I64_C(x) x##I64
    #else
        #define U64_C(x) x##ULL
        #define I64_C(x) x##LL
    #endif
#else
    #define U64   unsigned long long
    #define I64   signed long long
    #define U64_C(x) x##ULL
    #define I64_C(x) x##LL
#endif

#if (defined(_WIN64) || defined(__LP64__))  // 64-bit symbols used by Visual Studio and GCC, maybe others as well.
    #define PTR_ADDR  U64
#else
    #define PTR_ADDR  U32
#endif

#endif                      // Avoid multiple inclusion

/*************************** End of file ****************************/
